function hot_Administrator() {
    热菜.sort(function (x, y) {
        return Number(x.价格[0].原价 - x.价格[0].特价) - Number(y.价格[0].原价 - y.价格[0].特价)
    })
    document.getElementById("hot_Administrator").innerHTML = "";
    for (var a = 0; a < 热菜.length; a++) {
        var hot_原价 = 热菜[a].价格[0].原价;
        var hot_特价 = 热菜[a].价格[0].特价;
        var li = document.createElement("div");
        li.classList = 'menu';
        li.innerHTML =
            "<a href='JavaScript:;' class='num'>" + Number(a + 1) + "/" + 热菜.length + "  " + "</a>" +
            "<img src='" + 热菜[a].img + "' alt='图片未加载完成'/>" +
            "<input type='text' class = 'dish2 hot_dish' value='" + 热菜[a].name + "' maxlength='8' />" +
            "<textarea type='text' class='xiangqing2 hot_xiangqing'>" + 热菜[a].详情 + "</textarea>" +
            "<input type='number' class='yuanjia2 hot_yuanjia' value='" + hot_原价 + "' maxlength='5'/>" +
            "<input type='number' class='youhui2 hot_youhui' value='" + hot_特价 + "' maxlength='5'/>" +
            "<a href='JavaScript:;' class='xianjia hot_xianjia'>标价: " + Number(hot_原价 - hot_特价) + " 元</a>" +
            "<button href='JavaScript:;' class='buy'>删除</button>";
        document.getElementById("hot_Administrator").appendChild(li);
    }
}

function cool_Administrator() {
    凉菜.sort(function (x, y) {
        return Number(x.价格[0].原价 - x.价格[0].特价) - Number(y.价格[0].原价 - y.价格[0].特价)
    })
    document.getElementById("cool_Administrator").innerHTML = "";
    for (var a = 0; a < 凉菜.length; a++) {
        var 原价 = 凉菜[a].价格[0].原价;
        var 特价 = 凉菜[a].价格[0].特价;
        var li = document.createElement("div");
        li.classList = 'menu';
        li.innerHTML =
            "<a href='JavaScript:;' class='num'>" + Number(a + 1) + "/" + 凉菜.length + "  " + "</a>" +
            "<img src='" + 凉菜[a].img + "' alt='图片未加载完成'/>" +
            "<input type='text' class = 'dish2 cool_dish' value='" + 凉菜[a].name + "' maxlength='8' />" +
            "<textarea type='text' class='xiangqing2 cool_xiangqing'>" + 凉菜[a].详情 + "</textarea>" +
            "<input type='number' class='yuanjia2 cool_yuanjia' value='" + 原价 + "' maxlength='5'/>" +
            "<input type='number' class='youhui2 cool_youhui' value='" + 特价 + "' maxlength='5'/>" +
            "<a href='JavaScript:;' class='xianjia cool_xianjia'>标价: " + Number(原价 - 特价) + " 元</a>" +
            "<button href='JavaScript:;' class='buy'>删除</button>";
        document.getElementById("cool_Administrator").appendChild(li);
    }
}

function tang_Administrator() {
    汤.sort(function (x, y) {
        return Number(x.价格[0].原价 - x.价格[0].特价) - Number(y.价格[0].原价 - y.价格[0].特价)
    })
    document.getElementById("tang_Administrator").innerHTML = "";
    for (var a = 0; a < 汤.length; a++) {
        var 原价 = 汤[a].价格[0].原价;
        var 特价 = 汤[a].价格[0].特价;
        var li = document.createElement("div");
        li.classList = 'menu';
        li.innerHTML =
            "<a href='JavaScript:;' class='num'>" + Number(a + 1) + "/" + 汤.length + "  " + "</a>" +
            "<img src='" + 汤[a].img + "' alt='图片未加载完成'/>" +
            "<input type='text' class = 'dish2 tang_dish' value='" + 汤[a].name + "' maxlength='8' />" +
            "<textarea type='text' class='xiangqing2 tang_xiangqing'>" + 汤[a].详情 + "</textarea>" +
            "<input type='number' class='yuanjia2 tang_yuanjia' value='" + 原价 + "' maxlength='5'/>" +
            "<input type='number' class='youhui2 tang_youhui' value='" + 特价 + "' maxlength='5'/>" +
            "<a href='JavaScript:;' class='xianjia tang_xianjia'>标价: " + Number(原价 - 特价) + " 元</a>" +
            "<button href='JavaScript:;' class='buy'>删除</button>";
        document.getElementById("tang_Administrator").appendChild(li);
    }
}

function zhu_Administrator() {
    主食.sort(function (x, y) {
        return Number(x.价格[0].原价 - x.价格[0].特价) - Number(y.价格[0].原价 - y.价格[0].特价)
    })
    document.getElementById("zhu_Administrator").innerHTML = "";
    for (var a = 0; a < 主食.length; a++) {
        var 原价 = 主食[a].价格[0].原价;
        var 特价 = 主食[a].价格[0].特价;
        var li = document.createElement("div");
        li.classList = 'menu';
        li.innerHTML =
            "<a href='JavaScript:;' class='num'>" + Number(a + 1) + "/" + 主食.length + "  " + "</a>" +
            "<img src='" + 主食[a].img + "' alt='图片未加载完成'/>" +
            "<input type='text' class = 'dish2 zhu_dish' value='" + 主食[a].name + "' maxlength='8' />" +
            "<textarea type='text' class='xiangqing2 zhu_xiangqing'>" + 主食[a].详情 + "</textarea>" +
            "<input type='number' class='yuanjia2 zhu_yuanjia' value='" + 原价 + "' maxlength='5'/>" +
            "<input type='number' class='youhui2 zhu_youhui' value='" + 特价 + "' maxlength='5'/>" +
            "<a href='JavaScript:;' class='xianjia zhu_xianjia'>标价: " + Number(原价 - 特价) + " 元</a>" +
            "<button href='JavaScript:;' class='buy'>删除</button>";
        document.getElementById("zhu_Administrator").appendChild(li);
    }
}

function yan_Administrator() {
    香烟.sort(function (x, y) {
        return Number(x.价格[0].原价 - x.价格[0].特价) - Number(y.价格[0].原价 - y.价格[0].特价)
    })
    document.getElementById("yan_Administrator").innerHTML = "";
    for (var a = 0; a < 香烟.length; a++) {
        var 原价 = 香烟[a].价格[0].原价;
        var 特价 = 香烟[a].价格[0].特价;
        var li = document.createElement("div");
        li.classList = 'menu';
        li.innerHTML =
            "<a href='JavaScript:;' class='num'>" + Number(a + 1) + "/" + 香烟.length + "  " + "</a>" +
            "<img src='" + 香烟[a].img + "' alt='图片未加载完成'/>" +
            "<input type='text' class = 'dish2 yan_dish' value='" + 香烟[a].name + "' maxlength='8' />" +
            "<textarea type='text' class='xiangqing2 yan_xiangqing'>" + 香烟[a].详情 + "</textarea>" +
            "<input type='number' class='yuanjia2 yan_yuanjia' value='" + 原价 + "' maxlength='5'/>" +
            "<input type='number' class='youhui2 yan_youhui' value='" + 特价 + "' maxlength='5'/>" +
            "<a href='JavaScript:;' class='xianjia yan_xianjia'>标价: " + Number(原价 - 特价) + " 元</a>" +
            "<button href='JavaScript:;' class='buy'>删除</button>";
        document.getElementById("yan_Administrator").appendChild(li);
    }
}

function jiu_Administrator() {
    酒水.sort(function (x, y) {
        return Number(x.价格[0].原价 - x.价格[0].特价) - Number(y.价格[0].原价 - y.价格[0].特价)
    })
    document.getElementById("jiu_Administrator").innerHTML = "";
    for (var a = 0; a < 酒水.length; a++) {
        var 原价 = 酒水[a].价格[0].原价;
        var 特价 = 酒水[a].价格[0].特价;
        var li = document.createElement("div");
        li.classList = 'menu';
        li.innerHTML =
            "<a href='JavaScript:;' class='num'>" + Number(a + 1) + "/" + 酒水.length + "  " + "</a>" +
            "<img src='" + 酒水[a].img + "' alt='图片未加载完成'/>" +
            "<input type='text' class = 'dish2 jiu_dish' value='" + 酒水[a].name + "' maxlength='8' />" +
            "<textarea type='text' class='xiangqing2 jiu_xiangqing'>" + 酒水[a].详情 + "</textarea>" +
            "<input type='number' class='yuanjia2 jiu_yuanjia' value='" + 原价 + "' maxlength='5'/>" +
            "<input type='number' class='youhui2 jiu_youhui' value='" + 特价 + "' maxlength='5'/>" +
            "<a href='JavaScript:;' class='xianjia jiu_xianjia'>标价: " + Number(原价 - 特价) + " 元</a>" +
            "<button href='JavaScript:;' class='buy'>删除</button>";
        document.getElementById("jiu_Administrator").appendChild(li);
    }
}
$(document).on('change', '.hot_dish', function () {
    var a = $('.hot_dish').index(this);
    var name = document.getElementsByClassName('hot_dish')[a].value;
    if (name == "") {
        // document.getElementsByClassName('hot_dish')[a].value = 热菜[a].name;
        $(".hot_dish").eq(a).val(热菜[a].name);
    } else if (name.length > 8) {
        // document.getElementsByClassName('hot_dish')[a].value = 热菜[a].name;
        $(".hot_dish").eq(a).val(热菜[a].name);
        goumaijieguo = "菜名不能大于8位数";
        window.onload = chenggong2();
    } else {
        热菜[a].name = name;
        window.onload = hot_cai();
    }
})
$(document).on('input', '.hot_xiangqing', function () {
    var a = $('.hot_xiangqing').index(this);
    var name = document.getElementsByClassName('hot_xiangqing')[a].value;
    热菜[a].详情 = name;
    window.onload = hot_cai();
})
$(document).on('change', '.hot_yuanjia', function () {
    var a = $('.hot_yuanjia').index(this);
    var name = Number(document.getElementsByClassName('hot_yuanjia')[a].value);
    var b = Number(document.getElementsByClassName('hot_youhui')[a].value);
    if (name < 0) {
        document.getElementsByClassName('hot_yuanjia')[a].value = 热菜[a].价格[0].原价;
    } else if (name > 100000) {
        document.getElementsByClassName('hot_yuanjia')[a].value = 热菜[a].价格[0].原价;
        goumaijieguo = "原价不能大于5位数";
        window.onload = chenggong2();
        window.onload = chenggong2();;
    } else if (name < b) {
        goumaijieguo = "原价不能小于优惠金额";
        window.onload = chenggong2();
        document.getElementsByClassName('hot_yuanjia')[a].value = 热菜[a].价格[0].原价;
    } else {
        热菜[a].价格[0].原价 = name;
        $('.hot_xianjia').eq(a).text('标价: ' + Number(name - b));
        $('.hot_submit').eq(a).text("点菜: ¥ " + Number(name - b));
        window.onload = hot_cai();
    }
})
$(document).on('input', '.hot_youhui', function () {
    var a = $('.hot_youhui').index(this);
    var name = Number(document.getElementsByClassName('hot_youhui')[a].value);
    var b = Number(document.getElementsByClassName('hot_yuanjia')[a].value);
    if (name < 0) {
        document.getElementsByClassName('hot_youhui')[a].value = 0;
        热菜[a].价格[0].特价 = 0;
        goumaijieguo = "优惠价格不能为负数";
        window.onload = chenggong2();
    } else if (name > 100000) {
        document.getElementsByClassName('hot_youhui')[a].value = 热菜[a].价格[0].特价;
        goumaijieguo = "优惠价格不能大于5位数";
        window.onload = chenggong2();
    } else if (name > b) {
        goumaijieguo = "优惠价格不能大于原价";
        window.onload = chenggong2();
        document.getElementsByClassName('hot_youhui')[a].value = 热菜[a].价格[0].特价;
    } else {
        热菜[a].价格[0].特价 = name;
        $('.hot_xianjia').eq(a).text('标价: ' + Number(b - name));
        $('.hot_submit').eq(a).text("点菜: ¥ " + Number(b - name));
        window.onload = hot_cai();
    }
})
//凉菜
$(document).on('change', '.cool_dish', function () {
    var a = $('.cool_dish').index(this);
    var name = document.getElementsByClassName('cool_dish')[a].value;
    if (name == "") {
        document.getElementsByClassName('cool_dish')[a].value = 凉菜[a].name;
        goumaijieguo = "菜名不能为空";
        window.onload = chenggong2();;
    } else if (name.length > 8) {
        document.getElementsByClassName('cool_dish')[a].value = 凉菜[a].name;
        goumaijieguo = "菜名不能大于8位数";
        window.onload = chenggong2();
    } else {
        凉菜[a].name = name;
        window.onload = cool_cai();
    }
})
$(document).on('input', '.cool_xiangqing', function () {
    var a = $('.cool_xiangqing').index(this);
    var name = document.getElementsByClassName('cool_xiangqing')[a].value;
    凉菜[a].详情 = name;
    window.onload = cool_cai();
})
$(document).on('change', '.cool_yuanjia', function () {
    var a = $('.cool_yuanjia').index(this);
    var name = Number(document.getElementsByClassName('cool_yuanjia')[a].value);
    var b = Number(document.getElementsByClassName('cool_youhui')[a].value);
    if (name < 0) {
        document.getElementsByClassName('cool_yuanjia')[a].value = 0;
        凉菜[a].价格[0].原价 = 0;
        goumaijieguo = "原价不能为负数";
        window.onload = chenggong2();
    } else if (name > 100000) {
        document.getElementsByClassName('cool_yuanjia')[a].value = 凉菜[a].价格[0].原价;
        goumaijieguo = "原价不能大于5位数";
        window.onload = chenggong2();
        window.onload = chenggong2();
    } else if (name < b) {
        goumaijieguo = "原价不能小于优惠金额";
        window.onload = chenggong2();
        document.getElementsByClassName('cool_yuanjia')[a].value = 凉菜[a].价格[0].原价;
    } else {
        凉菜[a].价格[0].原价 = name;
        $('.cool_xianjia').eq(a).text('标价: ' + Number(name - b));
        $('.cool_submit').eq(a).text("点菜: ¥ " + Number(name - b));
        window.onload = cool_cai();
    }
})
$(document).on('input', '.cool_youhui', function () {
    var a = $('.cool_youhui').index(this);
    var name = Number(document.getElementsByClassName('cool_youhui')[a].value);
    var b = Number(document.getElementsByClassName('cool_yuanjia')[a].value);
    if (name < 0) {
        document.getElementsByClassName('cool_youhui')[a].value = 0;
        凉菜[a].价格[0].特价 = 0;
        goumaijieguo = "优惠价格不能为负数";
        window.onload = chenggong2();
    } else if (name.length > 5) {
        document.getElementsByClassName('cool_youhui')[a].value = 凉菜[a].价格[0].特价;
        goumaijieguo = "优惠价格不能大于5位数";
        window.onload = chenggong2();
    } else if (name > b) {
        goumaijieguo = "优惠价格不能大于原价";
        window.onload = chenggong2();
        document.getElementsByClassName('cool_youhui')[a].value = 凉菜[a].价格[0].特价;
    } else {
        凉菜[a].价格[0].特价 = name;
        $('.cool_xianjia').eq(a).text('标价: ' + Number(b - name));
        $('.cool_submit').eq(a).text("点菜: ¥ " + Number(b - name));
        window.onload = cool_cai();
    }
})
//汤类
$(document).on('change', '.tang_dish', function () {
    var a = $('.tang_dish').index(this);
    var name = document.getElementsByClassName('tang_dish')[a].value;
    if (name == "") {
        document.getElementsByClassName('tang_dish')[a].value = 汤[a].name;
        goumaijieguo = "菜名不能为空";
        window.onload = chenggong2();;
    } else if (name.length > 8) {
        document.getElementsByClassName('tang_dish')[a].value = 汤[a].name;
        goumaijieguo = "菜名不能大于8位数";
        window.onload = chenggong2();
    } else {
        汤[a].name = name;
        window.onload = tang_cai();
    }
})
$(document).on('input', '.tang_xiangqing', function () {
    var a = $('.tang_xiangqing').index(this);
    var name = document.getElementsByClassName('tang_xiangqing')[a].value;
    汤[a].详情 = name;
    window.onload = tang_cai();
})
$(document).on('change', '.tang_yuanjia', function () {
    var a = $('.tang_yuanjia').index(this);
    var name = Number(document.getElementsByClassName('tang_yuanjia')[a].value);
    var b = Number(document.getElementsByClassName('tang_youhui')[a].value);
    if (name < 0) {
        document.getElementsByClassName('tang_yuanjia')[a].value = 0;
        汤[a].价格[0].原价 = 0;
        goumaijieguo = "原价不能为负数";
        window.onload = chenggong2();
    } else if (name > 100000) {
        document.getElementsByClassName('tang_yuanjia')[a].value = 汤[a].价格[0].原价;
        goumaijieguo = "原价不能大于5位数";
        window.onload = chenggong2();
        window.onload = chenggong2();
    } else if (name < b) {
        goumaijieguo = "原价不能小于优惠金额";
        window.onload = chenggong2();
        document.getElementsByClassName('tang_yuanjia')[a].value = 汤[a].价格[0].原价;
    } else {
        汤[a].价格[0].原价 = name;
        $('.tang_xianjia').eq(a).text('标价: ' + Number(name - b));
        $('.tang_submit').eq(a).text("点菜: ¥ " + Number(name - b));
        window.onload = tang_cai();
    }
})
$(document).on('input', '.tang_youhui', function () {
    var a = $('.tang_youhui').index(this);
    var name = Number(document.getElementsByClassName('tang_youhui')[a].value);
    var b = Number(document.getElementsByClassName('tang_yuanjia')[a].value);
    if (name < 0) {
        document.getElementsByClassName('tang_youhui')[a].value = 0;
        汤[a].价格[0].特价 = 0;
        goumaijieguo = "优惠价格不能为负数";
        window.onload = chenggong2();
    } else if (name.length > 5) {
        document.getElementsByClassName('tang_youhui')[a].value = 汤[a].价格[0].特价;
        goumaijieguo = "优惠价格不能大于5位数";
        window.onload = chenggong2();
    } else if (name > b) {
        goumaijieguo = "优惠价格不能大于原价";
        window.onload = chenggong2();
        document.getElementsByClassName('tang_youhui')[a].value = 汤[a].价格[0].特价;
    } else {
        汤[a].价格[0].特价 = name;
        $('.tang_xianjia').eq(a).text('标价: ' + Number(b - name));
        $('.tang_submit').eq(a).text("点菜: ¥ " + Number(b - name));
        window.onload = tang_cai();
    }
})
//主食
$(document).on('change', '.zhu_dish', function () {
    var a = $('.zhu_dish').index(this);
    var name = document.getElementsByClassName('zhu_dish')[a].value;
    if (name == "") {
        document.getElementsByClassName('zhu_dish')[a].value = 主食[a].name;
        goumaijieguo = "菜名不能为空";
        window.onload = chenggong2();;
    } else if (name.length > 8) {
        document.getElementsByClassName('zhu_dish')[a].value = 主食[a].name;
        goumaijieguo = "菜名不能大于8位数";
        window.onload = chenggong2();
    } else {
        主食[a].name = name;
        window.onload = zhu_cai();
    }
})
$(document).on('input', '.zhu_xiangqing', function () {
    var a = $('.zhu_xiangqing').index(this);
    var name = document.getElementsByClassName('zhu_xiangqing')[a].value;
    主食[a].详情 = name;
    window.onload = zhu_cai();
})
$(document).on('change', '.zhu_yuanjia', function () {
    var a = $('.zhu_yuanjia').index(this);
    var name = Number(document.getElementsByClassName('zhu_yuanjia')[a].value);
    var b = Number(document.getElementsByClassName('zhu_youhui')[a].value);
    if (name < 0) {
        document.getElementsByClassName('zhu_yuanjia')[a].value = 0;
        主食[a].价格[0].原价 = 0;
        goumaijieguo = "原价不能为负数";
        window.onload = chenggong2();
    } else if (name > 100000) {
        document.getElementsByClassName('zhu_yuanjia')[a].value = 主食[a].价格[0].原价;
        goumaijieguo = "原价不能大于5位数";
        window.onload = chenggong2();
        window.onload = chenggong2();
    } else if (name < b) {
        goumaijieguo = "原价不能小于优惠金额";
        window.onload = chenggong2();
        document.getElementsByClassName('zhu_yuanjia')[a].value = 主食[a].价格[0].原价;
    } else {
        主食[a].价格[0].原价 = name;
        $('.zhu_xianjia').eq(a).text('标价: ' + Number(name - b));
        $('.zhu_submit').eq(a).text("点菜: ¥ " + Number(name - b));
        window.onload = zhu_cai();
    }
})
$(document).on('input', '.zhu_youhui', function () {
    var a = $('.zhu_youhui').index(this);
    var name = Number(document.getElementsByClassName('zhu_youhui')[a].value);
    var b = Number(document.getElementsByClassName('zhu_yuanjia')[a].value);
    if (name < 0) {
        document.getElementsByClassName('zhu_youhui')[a].value = 0;
        主食[a].价格[0].特价 = 0;
        goumaijieguo = "优惠价格不能为负数";
        window.onload = chenggong2();
    } else if (name.length > 5) {
        document.getElementsByClassName('zhu_youhui')[a].value = 主食[a].价格[0].特价;
        goumaijieguo = "优惠价格不能大于5位数";
        window.onload = chenggong2();
    } else if (name > b) {
        goumaijieguo = "优惠价格不能大于原价";
        window.onload = chenggong2();
        document.getElementsByClassName('zhu_youhui')[a].value = 主食[a].价格[0].特价;
    } else {
        主食[a].价格[0].特价 = name;
        $('.zhu_xianjia').eq(a).text('标价: ' + Number(b - name));
        $('.zhu_submit').eq(a).text("点菜: ¥ " + Number(b - name));
        window.onload = zhu_cai();
    }
})
//香烟
$(document).on('change', '.yan_dish', function () {
    var a = $('.yan_dish').index(this);
    var name = document.getElementsByClassName('yan_dish')[a].value;
    if (name == "") {
        document.getElementsByClassName('yan_dish')[a].value = 香烟[a].name;
        goumaijieguo = "菜名不能为空";
        window.onload = chenggong2();;
    } else if (name.length > 8) {
        document.getElementsByClassName('yan_dish')[a].value = 香烟[a].name;
        goumaijieguo = "菜名不能大于8位数";
        window.onload = chenggong2();
    } else {
        香烟[a].name = name;
        window.onload = yan_cai();
    }
})
$(document).on('input', '.yan_xiangqing', function () {
    var a = $('.yan_xiangqing').index(this);
    var name = document.getElementsByClassName('yan_xiangqing')[a].value;
    香烟[a].详情 = name;
    window.onload = yan_cai();
})
$(document).on('change', '.yan_yuanjia', function () {
    var a = $('.yan_yuanjia').index(this);
    var name = Number(document.getElementsByClassName('yan_yuanjia')[a].value);
    var b = Number(document.getElementsByClassName('yan_youhui')[a].value);
    if (name < 0) {
        document.getElementsByClassName('yan_yuanjia')[a].value = 0;
        香烟[a].价格[0].原价 = 0;
        goumaijieguo = "原价不能为负数";
        window.onload = chenggong2();
    } else if (name > 100000) {
        document.getElementsByClassName('yan_yuanjia')[a].value = 香烟[a].价格[0].原价;
        goumaijieguo = "原价不能大于5位数";
        window.onload = chenggong2();
        window.onload = chenggong2();
    } else if (name < b) {
        goumaijieguo = "原价不能小于优惠金额";
        window.onload = chenggong2();
        document.getElementsByClassName('yan_yuanjia')[a].value = 香烟[a].价格[0].原价;
    } else {
        香烟[a].价格[0].原价 = name;
        $('.yan_xianjia').eq(a).text('标价: ' + Number(name - b));
        $('.yan_submit').eq(a).text("点菜: ¥ " + Number(name - b));
        window.onload = yan_cai();
    }
})
$(document).on('input', '.yan_youhui', function () {
    var a = $('.yan_youhui').index(this);
    var name = Number(document.getElementsByClassName('yan_youhui')[a].value);
    var b = Number(document.getElementsByClassName('yan_yuanjia')[a].value);
    if (name < 0) {
        document.getElementsByClassName('yan_youhui')[a].value = 0;
        香烟[a].价格[0].特价 = 0;
        goumaijieguo = "优惠价格不能为负数";
        window.onload = chenggong2();
    } else if (name.length > 5) {
        document.getElementsByClassName('yan_youhui')[a].value = 香烟[a].价格[0].特价;
        goumaijieguo = "优惠价格不能大于5位数";
        window.onload = chenggong2();
    } else if (name > b) {
        goumaijieguo = "优惠价格不能大于原价";
        window.onload = chenggong2();
        document.getElementsByClassName('yan_youhui')[a].value = 香烟[a].价格[0].特价;
    } else {
        香烟[a].价格[0].特价 = name;
        $('.yan_xianjia').eq(a).text('标价: ' + Number(b - name));
        $('.yan_submit').eq(a).text("点菜: ¥ " + Number(b - name));
        window.onload = yan_cai();
    }
})
//酒水
$(document).on('change', '.jiu_dish', function () {
    var a = $('.jiu_dish').index(this);
    var name = document.getElementsByClassName('jiu_dish')[a].value;
    if (name == "") {
        document.getElementsByClassName('jiu_dish')[a].value = 酒水[a].name;
        goumaijieguo = "菜名不能为空";
        window.onload = chenggong2();;
    } else if (name.length > 8) {
        document.getElementsByClassName('jiu_dish')[a].value = 酒水[a].name;
        goumaijieguo = "菜名不能大于8位数";
        window.onload = chenggong2();
    } else {
        酒水[a].name = name;
        window.onload = jiu_cai();
    }
})
$(document).on('input', '.jiu_xiangqing', function () {
    var a = $('.jiu_xiangqing').index(this);
    var name = document.getElementsByClassName('jiu_xiangqing')[a].value;
    酒水[a].详情 = name;
    window.onload = jiu_cai();
})
$(document).on('change', '.jiu_yuanjia', function () {
    var a = $('.jiu_yuanjia').index(this);
    var name = Number(document.getElementsByClassName('jiu_yuanjia')[a].value);
    var b = Number(document.getElementsByClassName('jiu_youhui')[a].value);
    if (name < 0) {
        document.getElementsByClassName('jiu_yuanjia')[a].value = 0;
        酒水[a].价格[0].原价 = 0;
        goumaijieguo = "原价不能为负数";
        window.onload = chenggong2();
    } else if (name > 100000) {
        document.getElementsByClassName('jiu_yuanjia')[a].value = 酒水[a].价格[0].原价;
        goumaijieguo = "原价不能大于5位数";
        window.onload = chenggong2();
        window.onload = chenggong2();
    } else if (name < b) {
        goumaijieguo = "原价不能小于优惠金额";
        window.onload = chenggong2();
        document.getElementsByClassName('jiu_yuanjia')[a].value = 酒水[a].价格[0].原价;
    } else {
        酒水[a].价格[0].原价 = name;
        $('.jiu_xianjia').eq(a).text('标价: ' + Number(name - b));
        $('.jiu_submit').eq(a).text("点菜: ¥ " + Number(name - b));
        window.onload = jiu_cai();
    }
})
$(document).on('input', '.jiu_youhui', function () {
    var a = $('.jiu_youhui').index(this);
    var name = Number(document.getElementsByClassName('jiu_youhui')[a].value);
    var b = Number(document.getElementsByClassName('jiu_yuanjia')[a].value);
    if (name < 0) {
        document.getElementsByClassName('jiu_youhui')[a].value = 0;
        酒水[a].价格[0].特价 = 0;
        goumaijieguo = "优惠价格不能为负数";
        window.onload = chenggong2();
    } else if (name.length > 5) {
        document.getElementsByClassName('jiu_youhui')[a].value = 酒水[a].价格[0].特价;
        goumaijieguo = "优惠价格不能大于5位数";
        window.onload = chenggong2();
    } else if (name > b) {
        goumaijieguo = "优惠价格不能大于原价";
        window.onload = chenggong2();
        document.getElementsByClassName('jiu_youhui')[a].value = 酒水[a].价格[0].特价;
    } else {
        酒水[a].价格[0].特价 = name;
        $('.jiu_xianjia').eq(a).text('标价: ' + Number(b - name));
        $('.jiu_submit').eq(a).text("点菜: ¥ " + Number(b - name));
        window.onload = jiu_cai();
    }
})
console.log("%c我将玫瑰藏于身后，\n\r拭去荆棘赠于你手，\n见你眉眼温柔，\n浓情如故，\n误以为可以与你携手白头，\n后来呀,我再将玫瑰藏于身后，\n你已杳无音讯,只剩海棠依旧。",
    "background: rgba(252,234,187,1);background: -moz-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%,rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -webkit-gradient(left top, right top, color-stop(0%, rgba(252,234,187,1)), color-stop(12%, rgba(175,250,77,1)), color-stop(28%, rgba(0,247,49,1)), color-stop(39%, rgba(0,210,247,1)), color-stop(51%, rgba(0,189,247,1)), color-stop(64%, rgba(133,108,217,1)), color-stop(78%, rgba(177,0,247,1)), color-stop(87%, rgba(247,0,189,1)), color-stop(100%, rgba(245,22,52,1)));background: -webkit-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -o-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -ms-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: linear-gradient(to right, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#f51634', GradientType=1 );font-size:20px");
$(function () {
    document.getElementById('tianjia_Administrator').className = 'neirong content2';
    document.getElementById('hot_Administrator').className = 'neirong content2 show1';
    document.getElementById('cool_Administrator').className = 'neirong content2';
    document.getElementById('tang_Administrator').className = 'neirong content2';
    document.getElementById('zhu_Administrator').className = 'neirong content2';
    document.getElementById('yan_Administrator').className = 'neirong content2';
    document.getElementById('jiu_Administrator').className = 'neirong content2';
    document.getElementById('jiezhang_Administrator').className = 'neirong content2';
    $("#inventory").change(function () {
        let inventory = document.getElementById("inventory").getAttribute("src");
        console.log(inventory);
    })
    $("#confirm").click(function () {
        let a = $("#cai").val();
        let name = $("#name").val();
        let inventory = document.getElementById("inventory").getAttribute("src");
        let particulars = $("#particulars").val();
        let unit_price = $("#unit_price").val();
        let discounts = $("#discounts").val();
        if (name == "" && unit_price == "" && discounts == "") {
            goumaijieguo = "您还未进行编写";
            window.onload = chenggong2();
        } else if (name == '') {
            goumaijieguo = "菜名未编写";
            window.onload = chenggong2();
        } else if (name.length > 8) {
            goumaijieguo = "菜名不能大于8位数";
            window.onload = chenggong2();
            name.val('');
        } else if (unit_price == '') {
            goumaijieguo = "请输入单价";
            window.onload = chenggong2();
        } else if ($("#unit_price").val().length > 5) {
            goumaijieguo = "单价不能大于五位数";
            window.onload = chenggong2();
            $("#unit_price").val("");
        } else if (discounts == '') {
            goumaijieguo = "优惠内容未编写";
            window.onload = chenggong2();
        } else if (discounts.length > 5) {
            goumaijieguo = "优惠内容不能大于五位数";
            window.onload = chenggong2();
            discounts.val('');
        } else {
            if (a == "请选择要添加内容的种类") {
                goumaijieguo = "请添加菜品的种类";
                window.onload = chenggong2();
            } else if (a == "热菜") {
                热菜.push({
                    'name': name,
                    '库存': inventory,
                    '详情': particulars,
                    '价格': [{
                        '原价': unit_price,
                        '特价': discounts,
                    }]
                });
                window.onload = hot_cai();
                window.onload = hot_Administrator();
                goumaijieguo = "[热菜] " + name + " 添加成功";
                window.onload = chenggong2();
            } else if (a == "凉菜") {
                凉菜.push({
                    'name': name,
                    '库存': inventory,
                    '详情': particulars,
                    '价格': [{
                        '原价': unit_price,
                        '特价': discounts,
                    }]
                });
                window.onload = cool_cai();
                window.onload = cool_Administrator();
                goumaijieguo = "[凉菜] " + name + " 添加成功";
                window.onload = chenggong2();
            } else if (a == "汤") {
                汤.push({
                    'name': name,
                    '库存': inventory,
                    '详情': particulars,
                    '价格': [{
                        '原价': unit_price,
                        '特价': discounts,
                    }]
                });
                window.onload = tang_cai();
                window.onload = tang_Administrator();
                goumaijieguo = "[汤] " + name + " 添加成功";
                window.onload = chenggong2();
            } else if (a == "主食") {
                主食.push({
                    'name': name,
                    '库存': inventory,
                    '详情': particulars,
                    '价格': [{
                        '原价': unit_price,
                        '特价': discounts,
                    }]
                });
                window.onload = zhu_cai();
                window.onload = zhu_Administrator();
                goumaijieguo = "[主食] " + name + " 添加成功";
                window.onload = chenggong2();
            } else if (a == "香烟") {
                香烟.push({
                    'name': name,
                    '库存': inventory,
                    '详情': particulars,
                    '价格': [{
                        '原价': unit_price,
                        '特价': discounts,
                    }]
                });
                window.onload = yan_cai();
                window.onload = yan_Administrator();
                goumaijieguo = "[香烟] " + name + " 添加成功";
                window.onload = chenggong2();
            } else if (a == "酒水") {
                酒水.push({
                    'name': name,
                    '库存': inventory,
                    '详情': particulars,
                    '价格': [{
                        '原价': unit_price,
                        '特价': discounts,
                    }]
                });
                window.onload = jiu_cai();
                window.onload = jiu_Administrator();
                goumaijieguo = "[酒水] " + name + " 添加成功";
                window.onload = chenggong2();
            } else {
                goumaijieguo = "添加失败,修改元素内容被修改或没有该内容的选项";
                window.onload = chenggong2();
            }
            $(".menu").draggable();
        }
        //     // console.log("菜名: " + name + "\n单价: " + unit_price + "\n优惠: " + discounts + "\n加入了第 " + Number(a + 1) + " 个列表");
    })
    $("#一百元").click(function () {
        var 价格 = 感谢您曾经来过 + Number(100);
        感谢您曾经来过 = Number(价格);
        document.getElementById("钱包").innerHTML = "钱包剩余: <a href='JavaScript:;'>" + 感谢您曾经来过 + "</a> 元";
        goumaijieguo = "充值了: 100 ¥";
        window.onload = chenggong2();
    })
    $("#五百元").click(function () {
        var 价格 = 感谢您曾经来过 + Number(500);
        感谢您曾经来过 = Number(价格);
        document.getElementById("钱包").innerHTML = "钱包剩余: <a href='JavaScript:;'>" + 感谢您曾经来过 + "</a> 元";
        goumaijieguo = "充值了: 500 ¥";
        window.onload = chenggong2();
    })
    $("#确认自定义").click(function () {
        var 确认自定义 = $("#自定义").val();
        if (确认自定义 != "") {
            var 价格 = 感谢您曾经来过 + Number(确认自定义);
            感谢您曾经来过 = Number(价格);
            document.getElementById("钱包").innerHTML = "钱包剩余: <a href='JavaScript:;'>" + 感谢您曾经来过 + "</a> 元";
            goumaijieguo = "充值了: " + 确认自定义 + " ¥";
            window.onload = chenggong2();
        }
    })
    // $("#hot-ok").off("click");
    // $("#cool-ok").off("click");
    //获取页面的每个按钮
    var btns = document.getElementsByClassName("button") //获取内容盒子
    var contents = document.getElementsByClassName("content2");
    //遍历每个按钮为其添加点击事件
    for (var i = 0; i < btns.length; i++) {
        btns[i].index = i;
        btns[i].onclick = function () { //对当前点击的按钮赋予active类名及显示当前按钮对应的内容
            for (var j = 0; j < btns.length; j++) {
                btns[j].className = btns[j].className.replace(' active1', '').trim();
                contents[j].className = contents[j].className.replace(' show1', '').trim();
            }
            this.className = this.className + ' active1';
            contents[this.index].className = contents[this.index].className + ' show1';
        };
    }
    window.onload = hot_Administrator();
    window.onload = cool_Administrator();
    window.onload = tang_Administrator();
    window.onload = zhu_Administrator();
    window.onload = yan_Administrator();
    window.onload = jiu_Administrator();
    //热菜删除
    $(document).on("click", "#hot_Administrator .buy", function () {
        let a = $("#hot_Administrator .buy").index(this);
        let html = "管理员: " + unescape(unescape(unescape(qrgm[0].username))) + " 于 " + 时间 + "删除了 [热菜] 中 " + 热菜[a].name
        if (confirm("确认要删除 " + 热菜[a].name + " 吗?")) {
            console.log(html);
            热菜.splice(a, 1);
            window.onload = hot_Administrator();
            window.onload = hot_cai();
            goumaijieguo = html;
            window.onload = chenggong2();
        } else {
            //
        }
    })
    //删除凉菜
    $(document).on("click", "#cool_Administrator .buy", function () {
        let a = $("#cool_Administrator .buy").index(this);
        let html = "管理员: " + unescape(unescape(unescape(qrgm[0].username))) + " 于 " + 时间 + "删除了 [凉菜] 中 " + 凉菜[a].name;
        if (confirm("确定要删除 " + 凉菜[a].name + " 吗?")) {
            console.log(html);
            凉菜.splice(a, 1);
            window.onload = cool_Administrator();
            window.onload = cool_cai();
            goumaijieguo = html;
            window.onload = chenggong2();
        } else {
            //
        }

    })
    //删除汤内容
    $(document).on("click", "#tang_Administrator .buy", function () {
        let a = $("#tang_Administrator .buy").index(this);
        let html = "管理员: " + unescape(unescape(unescape(qrgm[0].username))) +
            "于" + 时间 + "删除了 [汤] 中 " + 汤[a].name;
        if (confirm("确定要删除 " + 凉菜[a].name + " 吗?")) {
            console.log(html);
            汤.splice(a, 1);
            window.onload = tang_Administrator();
            window.onload = tang_cai();
            goumaijieguo = html;
            window.onload = chenggong2()
        } else {
            //
        }

    })
    //删除主食内容
    $(document).on("click", "#zhu_Administrator .buy", function () {
        let a = $("#zhu_Administrator .buy").index(this);
        let html = "管理员: " + unescape(unescape(unescape(qrgm[0].username))) +
            "于" + 时间 + "删除了 [主食] 中 " + 主食[a].name;
        if (confirm("确认要删除 " + 主食[a].name) + " 吗?") {
            console.log(html);
            主食.splice(a, 1);
            window.onload = zhu_Administrator();
            window.onload = zhu_cai();
        } else {
            //
        }

    })
    //删除香烟内容
    $(document).on("click", "#yan_Administrator .buy", function () {
        let a = $("#yan_Administrator .buy").index(this);
        let html = "管理员: " + unescape(unescape(unescape(qrgm[0].username))) +
            "于" + 时间 + "删除了 [香烟] 中 " + 香烟[a].name;
        if (confirm("确定要删除 " + 香烟[a].name + " 吗?")) {
            console.log(html);
            香烟.splice(a, 1);
            window.onload = yan_Administrator();
            window.onload = yan_cai();
        } else {
            //
        }
    })
    //删除酒水内容
    $(document).on("click", "#jiu_Administrator .buy", function () {
        let a = $("#jiu_Administrator .buy").index(this);
        let html = "管理员: " + unescape(unescape(unescape(qrgm[0].username))) +
            "于" + 时间 + "删除了 [酒水] 中 " + 酒水[a].name;
        if (confirm("确定要删除 " + 酒水[a].name + " 吗?")) {
            console.log(html);
            酒水.splice(a, 1);
            window.onload = jiu_Administrator();
            window.onload = jiu_cai();
        } else {
            //
        }

    })
    //设置
    $("#kzshezhi a").attr("href", "JavaScript:;");
    $("#shezhi").click(function () {
        $("#kzshezhi").fadeIn();
        $(".shadow5").fadeIn();
    })
    $(document).on("click", "#kzshezhi .guanbi", function () {
        $("#kzshezhi").fadeOut();
        $(".shadow5").fadeOut();
        $("#cklsjl").fadeOut();
    })
    //字体样式
    $("#fontys").html(
        "<option></option>" +
        "<option>宋体</option>" +
        "<option>仿宋</option>" +
        "<option>幼圆</option>" +
        "<option>隶书</option>" +
        "<option>方正舒体</option>" +
        "<option>华文彩云</option>" +
        "<option>华文仿宋</option>" +
        "<option>华文行楷</option>" +
        "<option>华文隶书</option>" +
        "<option>华文新魏</option>" +
        "<option>微软雅黑</option>"
    );
    for (let a = 0; a < $("#fontys option").length; a++) {
        let font = $("#fontys option").eq(a).html();
        $("#fontys option").eq(a).css("font-family", font);
    }
    let b = $("body").css("font-family");
    $("#fontys option").eq(0).html(b);
    $(".show button").css("font-family", b);
    $(document).on("change", "#fontys", function () {
        let c = $("#fontys").val();
        $("body").css("font-family", c)
        $(".show button").css("font-family", c);
        goumaijieguo = "字体样式为: " + c + " ,部分样式可能会符号显示不出来";
        window.onload = chenggong2();
    })
    //背景颜色
    function back() {
        $("#back").html(
            "<option></option>" +
            "<option>rgba(0 ,0 ,0 ,0 )</option>" +
            "<option>#00f38a74</option>" +
            "<option>yellow</option>" +
            "<option>blue</option>" +
            "<option>#D24161</option>" +
            "<option></option>" +
            "<option></option>"
        );
    }
    back();
    let b2 = $("body").css("background-color");
    $("#back option").eq(0).html(b2);
    $("#back option").eq(0).css("background-color", b2);
    $(document).on("change", "#back", function () {
        let c = $("#back").val();
        $("body").css("background-color", c);
        $("#smh").fadeOut();
        goumaijieguo = "背景颜色修改为: " + c;
        window.onload = chenggong2();
    })
    for (let a = 0; a < $("#back option").length; a++) {
        let back = $("#back option").eq(a).html();
        $("#back option").eq(a).css("background-color", back);
    }
    //弹出框设置
    function tck2() {
        if (alert1 == 0) {
            $("#alert1").html(
                "<option>开</option>" +
                "<option>关</option>"
            )
        } else if (alert1 == 1) {
            $("#alert1").html(
                "<option>关</option>" +
                "<option>开</option>"
            )
        } else {
            $("#alert1").html(
                "<option>开</option>" +
                "<option>关</option>"
            )
        }
    }
    tck2();
    $(document).on("change", "#alert1", function () {
        let c = $("#alert1").val();
        if (c == "开") {
            alert1 = "0";
        } else if (c == "关") {
            alert1 = 1;
        } else {
            alert1 = 0;
            goumaijieguo = "文本内容被修改,已恢复默认: 当前通知栏状态: 开";
            window.onload = chenggong2();
            window.onload = tck2();
        }
    })
    $(document).on("click", "#small", function () {
        // alert1 = 0;
        $("#lsjl").click();
    })
    //历史记录
    $("#lsjl").html("点击查看部分历史记录 当前有: 0 个记录");
    $(document).on("click", "#lsjl", function () {
        if (夜萤火虫和你.length == 0) {
            //
        } else {
            $("#cklsjl").fadeIn();
            $("#kzshezhi").fadeOut();
            $(".shadow5").fadeIn();
            $("#cklsjl").html(
                "<h3 class='logo'>部分历史记录</h3>" +
                "<div class='guanbi'>&times;</div>"
            );
            for (let a = 0; a < 夜萤火虫和你.length; a++) {
                var li = document.createElement("a");
                // li.innerHTML = 夜萤火虫和你[a];
                document.getElementById("cklsjl").appendChild(li);
                $("#cklsjl a").eq(a).lbyl({
                    content: 夜萤火虫和你[a],
                    speed: 75,
                    hovertreeColors: ["#aaa"],
                    type: 'fade',
                })
            }
            $("#cklsjl a").attr("href", "JavaScript:;");
        }
    })
    $(document).on("click", "#cklsjl .guanbi", function () {
        $("#cklsjl").fadeOut();
        $("#kzshezhi").fadeIn();
        $("#cklsjl").html("");
    })
    //清空历史记录
    $(document).on("click", "#qklishi", function () {
        if (夜萤火虫和你.length == 0) {
            //
        } else {
            goumaijieguo = "历史记录已清除";
            window.onload = chenggong2();
            夜萤火虫和你.splice(夜萤火虫和你);
            $("#lsjl").html("点击查看部分历史记录 当前有: 0 个记录");
        }
    })
    //关于我们
    $(document).on("click", "#guanyuwomen", function () {
        $("#cklsjl").fadeIn();
        $("#kzshezhi").fadeOut();
        $("#cklsjl").html(
            "<a href='JavaScript:;' class='logo'>关于我们</a>" +
            "<div class='guanbi'>&times;</div>"
        );
    })
    //水墨画
    function yl() {
        $("#yl").html(
            "<option>请选择您要进入的页面</option>" +
            "<option>水墨画</option>" +
            "<option>爱心</option>"
        )
    }
    yl();
    $(document).on("change", "#yl", function () {
        var a = $("#yl").val();
        if (a == "水墨画") {
            window.open("游戏和其他页面/水墨画.html");
            // window.location = "游戏和其他页面/水墨画.html";
            goumaijieguo = "已为您跳转至: " + a;
            window.onload = chenggong2();
        } else if (a == "爱心") {
            window.open("../玩的/爱心.html");
            goumaijieguo = "已为您跳转至: " + a;
            window.onload = chenggong2();
        } else if (a == $("#yl option").eq(0).html()) {
            //
        } else {
            goumaijieguo = "当前 " + a + " 不可用重新选择";
            window.onload = chenggong2();
            window.onload = yl()
        }
    })
    //文本彩蛋
    const txt = [
        "不是每场相遇都有结局，但是每场相遇都有意义，也许他的出现，就是为了教给你人生某些东西，有些人适合让你成长，有些故事只适合收藏。",
        "你是雨中的蝴蝶,可惜我抓不住你",
    ];
    for (let j in txt) {
        let li = document.createElement("div");
        document.getElementById("wenben").appendChild(li);
    }
    $("#wenben div").eq(0).lbyl({
        content: txt[0],
        speed: 150,
        hovertreeColors: ['red', 'deeppink', 'blue', 'yellowgreen', 'green'],
        type: 'show',
        finished: function () {
            $("#wenben div").eq(1).lbyl({
                content: txt[1],
                speed: 150,
                type: 'fade',
            })
        }
    })
    //点击按钮重新排列
    $("#kzshezhi").on("click", "#cxpailie", function () {
        window.onload = hot_cai();
        window.onload = cool_cai();
        window.onload = tang_cai();
        window.onload = zhu_cai();
        window.onload = yan_cai();
        window.onload = jiu_cai();
        window.onload = xsgm();
        goumaijieguo = "页面重新排列成功!";
        chenggong2();
    })
})
window.addEventListener('load', function () {
    let body = document.body;
    let content = [
        "❤還會遇見她嗎❤",
        "❤她也曾爲我笑❤",
        "❤踮起脚吻你❤",
        "❤没关系的已经习惯了❤",
        "❤转身你已离开❤",
        // "❤感谢您为'味道小厨'带来温暖❤",
    ] //自定义内容的数组
    body.addEventListener('click', function (e) {
        let x = e.pageX;
        let y = e.pageY; //当前坐标
        let randContent = Math.ceil(Math.random() * content.length);
        let text = new Text(x, y, randContent);
        let span = document.createElement('span')
        span.style.color = text.getRandom();
        text.create(span);
        setTimeout(function () {
            text.out(span)
        }, 1900)
    })

    function Text(x, y, rand) {
        this.x = x;
        this.y = y;
        this.rand = rand;
    }
    Text.prototype.create = function (_this) {
        let body = document.body;
        _this.innerHTML = content[this.rand - 1];
        _this.className = 'aixin'
        _this.style.top = this.y - 20 + 'px'
        _this.style.left = this.x - 50 + 'px'
        _this.style.animation = 'remove 2s'
        body.appendChild(_this);
        let i = 0
        setInterval(() => {
            _this.style.top = this.y - 20 - i + 'px'
            i++
        }, 10);
    }
    Text.prototype.out = function (_this) {
        _this.remove()
    }
    //设置随机颜色
    Text.prototype.getRandom = function () {
        let allType = '0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f'; //16进制颜色
        let allTypeArr = allType.split(','); //通过','分割为数组
        let color = '#';
        for (var i = 0; i < 6; i++) {
            //随机生成一个0-16的数
            var random = parseInt(Math.random() * allTypeArr.length);
            color += allTypeArr[random];
        }
        return color; //返回随机生成的颜色
    }
})